import Vue from 'vue';
import Router from 'vue-router';
import HelloWorld from '@/components/HelloWorld';
import login from '@/components/login';
import home from '@/components/home';
import sort_list from '@/components/sort_list';
import sort_add from '@/components/sort_add';
import commodity_add from '@/components/commodity_add';
import commodity_edit from '@/components/commodity_edit';
import commodity_list_edit from '@/components/commodity_list_edit';
import admin_list from '@/components/admin_list';
import admin_add from '@/components/admin_add';
import change_user_password from '@/components/change_user_password';
import order_list from '@/components/order_list';
import roll_image_list from '@/components/roll_image_list';
import roll_image_add from '@/components/roll_image_add';
import commodity_list from '@/components/commodity_list';
import article_list from '@/components/article_list';
import article_edit from '@/components/article_edit';
Vue.use(Router);

export default new Router({
    base: '/admin',
    routes: [{
            path: '/',
            name: 'home',
            component: home
        },
        {
            path: '/HelloWorld',
            name: 'HelloWorld',
            component: HelloWorld
        },
        {
            path: '/login',
            name: 'login',
            component: login
        },
        {
            path: '/home',
            name: 'home',
            component: home,
            children: [

                {
                    path: '/sort_list',
                    name: 'sort_list',
                    component: sort_list
                },
                {
                    path: '/sort_add',
                    name: 'sort_add',
                    component: sort_add
                },
                {
                    path: '/commodity_add',
                    name: 'commodity_add',
                    component: commodity_add
                },
                {
                    path: '/commodity_edit',
                    name: 'commodity_edit',
                    component: commodity_edit
                },
                {
                    path: '/admin_list',
                    name: 'admin_list',
                    component: admin_list
                },
                {
                    path: '/admin_add',
                    name: 'admin_add',
                    component: admin_add
                },
                {
                    path: '/change_user_password',
                    name: 'change_user_password',
                    component: change_user_password
                },
                {
                    path: '/order_list',
                    name: 'order_list',
                    component: order_list
                },
                {
                    path: '/roll_image_list',
                    name: 'roll_image_list',
                    component: roll_image_list
                },
                {
                    path: '/roll_image_add',
                    name: 'roll_image_add',
                    component: roll_image_add
                },
                {
                    path: '/commodity_list',
                    name: 'commodity_list',
                    component: commodity_list
                },
                {
                    path: '/commodity_list_edit',
                    name: 'commodity_list_edit',
                    component: commodity_list_edit
                },
                {
                    path: '/article_list',
                    name: 'article_list',
                    component: article_list
                },
                {
                    path: '/article_edit',
                    name: 'article_edit',
                    component: article_edit
                },
            ]
        }
    ]
});